home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / cellgame.swf / scripts / frame_2 / PlaceObject2_19_10 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  1.4 KB  |  63 lines

  1. onClipEvent(enterFrame){
  2.    if(_visible == 0)
  3.    {
  4.       amoebaSound.stop();
  5.       soundStartable = true;
  6.       _X = -30;
  7.       xDirection = random(2);
  8.       if(xDirection == 0)
  9.       {
  10.          xSpeed = 4;
  11.       }
  12.       if(xDirection == 1)
  13.       {
  14.          xSpeed = -4;
  15.       }
  16.    }
  17.    if(getTimer() - appearTime > pause)
  18.    {
  19.       _visible = 1;
  20.    }
  21.    if(_visible)
  22.    {
  23.       _root.actions.collisions(this);
  24.       _root.actions.wrapAround(this);
  25.       if(_root.startButton._alpha < 10 && soundStartable)
  26.       {
  27.          amoebaSound.start(0,99999);
  28.          amoebaSound.setVolume(50);
  29.          soundStartable = false;
  30.       }
  31.       if(_root.ship._alpha > 90 && !firing && _X > 100 && _X < 500)
  32.       {
  33.          firing = true;
  34.          duplicateMovieClip(_root.amoebaShot,"newShot5000",21384);
  35.       }
  36.       if(getTimer() - appearTime > 30000 && (_X < 0 || _X > 640))
  37.       {
  38.          _root.actions.death(this);
  39.       }
  40.       _X = _X + xSpeed;
  41.       _Y = _Y + ySpeed;
  42.       _rotation = _rotation + rotateSpeed;
  43.    }
  44.    if(getTimer() - moveTime > random(2000) + 2000)
  45.    {
  46.       yDirection = random(3);
  47.       rotateSpeed = random(8) - 4;
  48.       moveTime = getTimer();
  49.       if(yDirection == 0)
  50.       {
  51.          ySpeed = 4;
  52.       }
  53.       if(yDirection == 1)
  54.       {
  55.          ySpeed = -4;
  56.       }
  57.       if(yDirection == 2)
  58.       {
  59.          ySpeed = 0;
  60.       }
  61.    }
  62. }
  63.